package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class WriteStringDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("fos.txt",true);
        fos.write("爱你孤身走暗巷".getBytes(StandardCharsets.UTF_8));
        fos.write("爱你不跪的模样".getBytes(StandardCharsets.UTF_8));
        fos.close();
        System.out.println("输出完毕");





















        /*FileOutputStream fos = new FileOutputStream("fos.txt");
        String line = "你是什么东西，是那个东西吗";
        byte[] data = line.getBytes(StandardCharsets.UTF_8);
        line = "aaaaaa";
        byte[] bytes = line.getBytes(StandardCharsets.UTF_8);
        fos.write(data);
        fos.write(bytes);
        System.out.println("输入完毕！");
        fos.close();*/
    }
}
